/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class TestDemo {
    public static void main(String[] args) {
        int[] array = {1,2,3,5,4};
        int ret = estiMate(array);
        if(1 == ret){
            System.out.println("有序");
        }else{
            System.out.println("无序");
        }
    }

    public static int estiMate(int[] array){
        if(array[array.length-1] > array[array.length-2]){
            for (int i = 0; i < array.length-2; i++) {
                if(array[i+1] < array[i]){
                    return 0;
                }
            }
            return 1;
        }else{
            return 0;
        }
    }
}
